#dict is map,hashmap
dict1={'key1':'value1',('key2,but this key is tuple','key2 is a tuple'):'values2',3:['values3 is a list','heihei']}
#the keys is la list
print dict1.keys()
#the values is a list too
print dict1.values()
print dict1.get('key1')
for k in dict1:
    print k,dict1[k]
for k,v in dict1.items():
    print k,v
#if the key is not in the dict ,return the what you set
print dict1.get('the key is not here','there is not key2')
#check the key whther is in dict
print 'key1' in dict1
print dict1.has_key('key1')
#pop the key-value,then return the value
print dict1.pop('key1','there is not the key1')
#because pop the key1 ,so dict1 remove the key1 and its values
print dict1
#update,for exmple,dic1.update(dict2),it use dict2 update dict1
dict2={'k4':4,'k5':5}
dict1.update(dict2)
print dict1
print  dict1.has_key('k4')
#new a dict by fromKeys,reset all
dict3 = dict1.fromkeys('abcdefg','the value is same for iterater')
print dict3
print dict1